use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use rust_decimal::Decimal;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "orders")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: String,
    pub customer_id: String,
    pub pickup_address: String,
    pub delivery_address: String,
    pub weight: Decimal,
    pub volume: Decimal,
    pub status: i32, // 0: pending, 1: assigned, 2: picked_up, 3: in_transit, 4: delivered, 5: cancelled
    pub pickup_time_window_start: Option<DateTime>,
    pub pickup_time_window_end: Option<DateTime>,
    pub delivery_time_window_start: Option<DateTime>,
    pub delivery_time_window_end: Option<DateTime>,
    pub special_requirements: Option<String>,
    pub created_at: DateTime,
    pub updated_at: DateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}